Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id JAA19658
for <mcox@access.digex.net>; Sun, 20 Apr 1997 09:32:09 -0400 (EDT)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id IAA03089
for amos-out; Sun, 20 Apr 1997 08:01:13 -0400 (EDT)
Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id IAA03086
for <amos-list@svcs1.digex.net>; Sun, 20 Apr 1997 08:01:12 -0400 (EDT)
Received: from top.quark.it (root@[195.36.4.1])
by mail1.access.digex.net (8.8.5/8.8.5) with SMTP id IAA22040
for <amos-list@access.digex.net>; Sun, 20 Apr 1997 08:01:08 -0400 (EDT)
Received: from not.configured.com ([195.36.6.38]) by top.quark.it (8.6.11/8.6.11) with SMTP id OAA26788 for <amos-list@access.digex.net>; Sun, 20 Apr 1997 14:06:36 +0200
Date: 17 Apr 97 22:33:21 +0100
From: fbazzo@quark.it (Fabrizio Bazzo)
Subject: Re: date
To: amos-list@access.digex.net (AMOS list)
In-Reply-To: <334be544@karkis.canit.se>
Message-ID: <1834.7046T1353T1070@quark.it>
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Mailer: THOR 2.3 (Amiga;TCP/IP)
Lines: 82
Status: RO
X-Status:
>I want to read the date in my computer with amos without using 'copy date to
>ram'
>I did get some answer before but I couldn't get it to work.
This is a ready-to-use procedure that was originally on
the Extras disk of Amos1.3: cut,paste and enjoy ;)
'----------------------------------
' How to get TIME and DATE in AMOS
'----------------------------------
'
_DATE$ : Print Param$
_TIME$ : Print Param$
'
Procedure _DATE$
'
' Call DOS DateStamp function
T$=Space$(12)
Dreg(1)=Varptr(T$)
RIEN=Doscall(-192)
NJ=Leek(Varptr(T$))
'
' Find this year's first day
A=1978 : JOUR=7
Do
BIS=0 : If(A and 3)=0 : BIS=1 : End If
Exit If NJ-365-BIS<0
Add JOUR,1+BIS : If JOUR>7 : Add JOUR,-7 : End If
Add NJ,-365-BIS
Inc A
Loop
'
' Find month
M=1
Do
Read N
Exit If NJ-N<0
Add NJ,-N : Inc M
Loop
Inc NJ
'
' Fabrique la chaine
J$=Mid$(Str$(NJ),2) : If Len(J$)<2 : J$="0"+J$ : End If
M$=Mid$(Str$(M),2) : If Len(M$)<2 : M$="0"+M$ : End If
A$=Mid$(Str$(A),2)
DATE$=J$+"-"+M$+"-"+A$
'
' Length of each month
Data 31,28+BIS,31,30,31,30,31,31,30,31,30,31
'
End Proc[DATE$]
Procedure _TIME$
'
' Call DOS function
T$=Space$(12)
Dreg(1)=Varptr(T$)
RIEN=Doscall(-192)
MN=Leek(Varptr(T$)+4)
SEC=Leek(Varptr(T$)+8)
'
' Minutes calculation
H=MN/60 : H$=Mid$(Str$(H),2) : If Len(H$)<2 : H$="0"+H$ : End If
M=MN mod 60 : M$=Mid$(Str$(M),2) : If Len(M$)<2 : M$="0"+M$ : End If
'
' Seconds calculation
S=SEC/50 : S$=Mid$(Str$(S),2) : If Len(S$)<2 : S$="0"+S$ : End If